package com.srt.util;

/**
 * 生成Result对象的工具类
 *
 * @name: ResultUtils
 * @author: rd07
 * @date: 2020/8/3
 * @time: 13:21
 */
public class ResultUtils {

    /**
     * 获取成功的Result
     *
     * @param obj
     * @return
     */
    public static Result getSuccess(Object obj) {
        return new Result("200", "", obj);
    }

    /**
     * 获取失败的Result
     *
     * @param code
     * @param description
     * @return
     */
    public static Result getFailure(String code, String description) {
        return new Result(code, description, null);
    }

    /**
     * 获取系统级别的失败Result
     *
     * @param description
     * @return
     */
    public static Result getSysFailure(String description) {
        return new Result("-1", description, null);
    }
}
